/* 
    var obj1 = new Object();
    var obj2 = {};

    console.log(Object.getPrototypeOf(obj1) === Object.prototype);
    console.log(Object.getPrototypeOf(obj2) === Object.prototype); 
*/

/* 
    var A = function() {}
    A.prototype = {name: 'sven'};
    var B = function() {}
    B.prototype = new A();

    var b = new B();
    console.log(b.name);
 */

/* 
 var p = {};
 var a = Object.create(p);
 var o = Object.create(null);
 console.log(o.__proto__);
 console.log(a.__proto__, Object.getPrototypeOf(a) === p);
*/

class Animal {
    constructor(name) {
        this.name = name;
    }

    getName() {
        console.log(this.name)
    }
}


class Dog extends Animal {
    constructor(name) {
        super(name);
    }

    speak() {
        console.log('woof');
    }
}

var doy = new Dog('doy');
doy.speak();